<?php

$a = [];
$a[1] = 'a';
debug_zval_dump($a);
exit;
$res = [1,2,4,65,76];


function search ($arr,$search,$start,$end) {
	
	$min = intval(($start + $end) / 2);
	while($start <= $end) {
		if ($arr[$min] == $search) {
			return $min;
		} elseif ($arr[$min] < $search) {
			$start = $min + 1;
		} else {
			$end = $min - 1;
		}
	
	}
return false;
}

function search1 ($arr, $search, $start, $end) {
	$min = intval(($end + $start) / 2);
	while ($start <= $end) {
		if ($arr[$min] == $search) {
			return $min;
		} elseif ($arr[$min] < $search) {
				$start = $min +1;
		} else {
			$end = $min -1;
		}
	}
	return false;
}




function search2 ($arr, $search, $start, $end) {
	$min = intval(($start + $end) /2);

	while ($start <= $end) {
		if ($arr[$min] == $search) {
			return $min;
		} else if($arr[$min] < $search) {
			$start = $min +1;
		} else {
			$end = $min -1;
		}
	}
	 return false;
}

$a = search2($res,4,0,4);

echo $a;

